import { addressType } from '@/typrs/address';
import { getWithoutAuth, postWithoutAuth } from '../utils/httpClient';

export const freemarkerAPI = async (ftl: string, json: string): Promise<string> => {
    return await postWithoutAuth('/api/utils/freemarker', {
        ftlTxt: ftl,
        jsonTxt: json
    });
};

export const addressAPI = async (data: string): Promise<string> => {
    return await postWithoutAuth('/api/utils/address', {
        batchData: data.split('\n')
    });
};

export const addressListAPI = async (requestId: string): Promise<addressType> => {
    return await getWithoutAuth('/api/utils/address/' + requestId);
};